import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DemoVO, DemoVOarr, DemoForm, DemoQuery, DemoQueryarr } from '@/api/system/liveStream/types';

/**
 * 查询列表
 * @param query
 * @returns {*}
 */
export const list = (query?: DemoQuery): AxiosPromise<DemoVO[]> => {
  return request({
    url: '/script/list',
    method: 'get',
    params: query
  });
};

/**
 *新增产品话术
 * @param data
 */
 export const scriptAdd = (data: DemoForm) => {
  return request({
    url: '/script/add',
    method: 'post',
    data: data
  });
};

/**
 * 删除话术
 * @param ids
 */
export const delDemo = (ids: string | number | Array<string | number>) => {
  return request({
    url: '/script/' + ids,
    method: 'delete'
  });
};

/**
 *生成话术
 * @param data
 */
export const script = (data: DemoForm) => {
  return request({
    url: '/script/script',
    method: 'post',
    data: data
  });
};

/**
 * 查询数字人列表
 * @param query
 * @returns {*}
 */
export const listarr = (query?: DemoQueryarr): AxiosPromise<DemoVOarr[]> => {
  return request({
    url: '/digital/list',
    method: 'get',
    params: query
  });
};

/**
 *新增作品
 * @param data
 */
 export const works = (data: DemoForm) => {
  return request({
    url: '/works/add',
    method: 'post',
    data: data
  });
};
